Skip to content

Conversation

@ldematte
Copy link
Contributor

Forward-port of 9166b5d

While backporting #122232, I found that it is convenient to change lookupImplementationMethod to have the same behaviour of lookupMethods; this way the lookup will always find the correct interface, without the need to specify it manually.

Since the 2 functions now share the same basic structure, I refactored them to share a common helper and a consistent signature (exception thrown).

@ldematte ldematte added :Core/Infra/Core Core issues without another label >refactoring auto-backport Automatically create backport pull requests when merged test-entitlements v9.0.1 v9.1.0 labels Feb 13, 2025
@ldematte ldematte requested a review from a team February 13, 2025 08:41
@elasticsearchmachine elasticsearchmachine added the Team:Core/Infra Meta label for core/infra team label Feb 13, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

Copy link
Contributor

@mosche mosche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, though it's not directly obvious to me where this is required

@ldematte
Copy link
Contributor Author

lgtm, though it's not directly obvious to me where this is required

That's because main is "lucky" :) and does not have to support Java < 21. So yes, there is not direct application for this here yet.
But if you look at 8.x (e.g. #122471), you'll see that we have some FileStore functions that are only available for Java 20+; that means the interface that defines them is Java20EntitlementChecker, which (for code organization/reuse reasons) is split between 2 interfaces (preview and stable). Now, instead of forcing people to remember and specify the specific interface, I preferred to re-use the same mechanism we have and navigate automatically the hierarchy.

@ldematte ldematte merged commit 0810e66 into elastic:main Feb 13, 2025
22 checks passed
@ldematte ldematte deleted the entitlements/lookup-implementation-method-fix branch February 13, 2025 21:08
ldematte added a commit to ldematte/elasticsearch that referenced this pull request Feb 13, 2025
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
9.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged :Core/Infra/Core Core issues without another label >refactoring Team:Core/Infra Meta label for core/infra team v9.0.1 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants